remotemanager.transport.cp module¶
Handles file transfer via cp
- class remotemanager.transport.cp.cp(*args, **kwargs)[source]¶
- cmd(primary, secondary)[source]¶
Returns a formatted command for issuing transfers. It is left to the developer to implement this method when adding more transport classes.
The implementation should take two strings as arguments, primary and secondary:
- Parameters:
primary (str) –
The source folder, containing the files for transfer. Input will be semi-formatted already in bash form.
e.g. directory_name/{file1,file2,file3,…,fileN}
secondary (str) – The destination folder for the files
At its most basic:
``` def cmd(self, primary, secondary):
cmd = “command {primary} {secondary}” base = cmd.format(primary=primary, secondary=secondary) return base
You can, of course, extend upon this. View the included transport methods for ideas on how to do this.
- Returns (str):
formatted command for issuing a transfer